package com.itheima.controller;



import com.itheima.common.ResultData;
import com.itheima.domain.CmsPrefrenceArea;
import com.itheima.service.CmsPrefrenceAreaService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 优选专区 前端控制器
 * </p>
 *
 * @author XiaoRan
 * @since 2022-08-02
 */
@Slf4j
@RestController
@CrossOrigin(origins = "*")
@RequestMapping("prefrenceArea")
public class CmsPrefrenceAreaController {
    @DubboReference
    private CmsPrefrenceAreaService cmsPrefrenceAreaService;

    //获取所有商品优选
    @GetMapping("/listAll")
    public ResultData listAll() {
        log.info("获取所有商品优选");
        List<CmsPrefrenceArea> list = cmsPrefrenceAreaService.list();
        return ResultData.ok(list,"");
    }
}
